<template>
    <view style="width: 100%; height: 100%" v-if="url">
      <iframe style="width: 100%; height: 100vh; border: 0" frameborder="0" :src="url"></iframe>
    </view>
  </template>
  <script setup name="Answer">
  import Cookies from "js-cookie";
  import { inject, onMounted } from "vue";
  const host = inject("host");
  const url = ref(null);
  onMounted(() => {
    let selectedExam = Cookies.get("selectedExam");
    selectedExam = JSON.parse(selectedExam);
    url.value =  "http://viewer.apisev.cn/viewer/preview/remote?url=" + encodeURIComponent(selectedExam.answerUrl);
    console.log(url.value);
  });
  </script>
  